﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

struct student
{
    string id;
    string name;
    int grade;
    string major;          
}
namespace SQLhomework
{
    public partial class UserForm : UserControl
    {
        public StudentMessage studentMessage;
        public ClassMessage classMessage;
        //声明学生信息窗口对象
        public UserForm()
        {
            InitializeComponent();
            //窗口对象实例化
            
            this.studentMessage = new StudentMessage();
            this.classMessage = new ClassMessage();


            //默认进入界面是学生信息
            changePanel2(this.studentMessage);
        }

        private void UserControl1_Load(object sender, EventArgs e)
        {

        }
        //学生信息
        private void button1_Click(object sender, EventArgs e)
        {
            //splitContainer.Panel2.Controls.Clear();
            //splitContainer.Panel2.Controls.Add(studentMessage);
            changePanel2(this.studentMessage);
        }
        private void button1_Click_1(object sender, EventArgs e)
        {
            changePanel2(this.classMessage);
            classMessage.DrawUI();
        }
        private void changePanel2(Control panel)
        {
            splitContainer.Panel2.Controls.Clear();
            splitContainer.Panel2.Controls.Add(panel);
        }

        private void splitContainer_Panel2_Paint(object sender, PaintEventArgs e)
        {

        }

       
    }
}
